{"ast":null,"code":"import _regeneratorRuntime from\"/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js\";import _asyncToGenerator from\"/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\";import _classCallCheck from\"/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/@babel/runtime/helpers/esm/classCallCheck.js\";import _createClass from\"/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/@babel/runtime/helpers/esm/createClass.js\";import apiClient from\"../http\";import{profile as _profile,deleteUser,changeProfile,uploadAvatar as _uploadAvatar}from\"../routes\";var UserService=/*#__PURE__*/function(){function UserService(){_classCallCheck(this,UserService);}_createClass(UserService,null,[{key:\"profile\",value:function(){var _profile2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){return _regeneratorRuntime().wrap(function _callee$(_context){while(1){switch(_context.prev=_context.next){case 0:return _context.abrupt(\"return\",apiClient.get(_profile()));case 1:case\"end\":return _context.stop();}}},_callee);}));function profile(){return _profile2.apply(this,arguments);}return profile;}()},{key:\"deleteProfile\",value:function(){var _deleteProfile=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(){return _regeneratorRuntime().wrap(function _callee2$(_context2){while(1){switch(_context2.prev=_context2.next){case 0:return _context2.abrupt(\"return\",apiClient.delete(deleteUser()));case 1:case\"end\":return _context2.stop();}}},_callee2);}));function deleteProfile(){return _deleteProfile.apply(this,arguments);}return deleteProfile;}()},{key:\"updateProfile\",value:function(){var _updateProfile=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(profileRequest){return _regeneratorRuntime().wrap(function _callee3$(_context3){while(1){switch(_context3.prev=_context3.next){case 0:return _context3.abrupt(\"return\",apiClient.put(changeProfile(),profileRequest));case 1:case\"end\":return _context3.stop();}}},_callee3);}));function updateProfile(_x){return _updateProfile.apply(this,arguments);}return updateProfile;}()},{key:\"uploadAvatar\",value:function(){var _uploadAvatar2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(file){return _regeneratorRuntime().wrap(function _callee4$(_context4){while(1){switch(_context4.prev=_context4.next){case 0:return _context4.abrupt(\"return\",apiClient.post(_uploadAvatar(),file));case 1:case\"end\":return _context4.stop();}}},_callee4);}));function uploadAvatar(_x2){return _uploadAvatar2.apply(this,arguments);}return uploadAvatar;}()}]);return UserService;}();export{UserService as default};","map":{"version":3,"names":["apiClient","profile","deleteUser","changeProfile","uploadAvatar","UserService","get","delete","profileRequest","put","file","post"],"sources":["/Users/poppie/Desktop/development/messenger/app/frontend/src/services/UserService.ts"],"sourcesContent":["import apiClient from \"../http\";\nimport {AxiosResponse} from 'axios';\nimport {profile, deleteUser, changeProfile, uploadAvatar} from \"../routes\"\nimport {UserListItem} from \"../models/response/UserListItem\";\nimport {DeleteUserResponse} from \"../models/response/Other/DeleteUserResponse\";\nimport ProfileRequest from \"../models/request/ProfileRequest\";\nimport {ContentListItem} from \"../models/response/ContentListItem\";\n\nexport default class UserService {\n    public static async profile(): Promise<AxiosResponse<UserListItem>> {\n        return apiClient.get<UserListItem>(profile());\n    }\n\n    public static async deleteProfile(): Promise<AxiosResponse<DeleteUserResponse>> {\n        return apiClient.delete<DeleteUserResponse>(deleteUser());\n    }\n\n    public static async updateProfile(profileRequest: ProfileRequest): Promise<AxiosResponse<UserListItem>> {\n        return apiClient.put<UserListItem>(changeProfile(), profileRequest);\n    }\n\n    public static async uploadAvatar(file: FormData): Promise<AxiosResponse<ContentListItem>> {\n        return apiClient.post(uploadAvatar(), file);\n    }\n}"],"mappings":"skBAAA,MAAOA,UAAS,KAAM,SAAS,CAE/B,OAAQC,OAAO,GAAPA,SAAO,CAAEC,UAAU,CAAEC,aAAa,CAAEC,YAAY,GAAZA,cAAY,KAAO,WAAW,IAMrDC,YAAW,0NAC5B,qKACWL,SAAS,CAACM,GAAG,CAAeL,QAAO,EAAE,CAAC,wDAChD,qMAED,2KACWD,SAAS,CAACO,MAAM,CAAqBL,UAAU,EAAE,CAAC,0DAC5D,sNAED,kBAAkCM,cAA8B,yJACrDR,SAAS,CAACS,GAAG,CAAeN,aAAa,EAAE,CAAEK,cAAc,CAAC,0DACtE,uNAED,kBAAiCE,IAAc,yJACpCV,SAAS,CAACW,IAAI,CAACP,aAAY,EAAE,CAAEM,IAAI,CAAC,0DAC9C,oIAfgBL,WAAW"},"metadata":{},"sourceType":"module"}